﻿@model BackEnd.Models.ArtistModel
@{
    ViewBag.Title = "Update Artist";
}

  <h2>Update Artist</h2>
    @using (Html.BeginForm()) {
        @Html.ValidationSummary(true, "Artist update was unsuccessful. Please correct the errors and try again.", new { @class="error_box" })
                        
        if(ViewData["ErrorMessage"]!=null){
         @Html.Label(ViewData["ErrorMessage"].ToString())
         }
        <div>
                           
                @Html.HiddenFor(m => m.ArtistId)
                        
                <table>
                <tr>
                    <td class="editor-label">
                        @Html.LabelFor(m => m.FullName)
                    </td>
                    <td class="editor-field">
                        @Html.TextBoxFor(m => m.FullName)
                        @Html.ValidationMessageFor(m => m.FullName)
                    </td>
                </tr>
                <tr>
                    <td class="editor-label">
                        @Html.LabelFor(m => m.FirstName)
                    </td>
                    <td class="editor-field">
                        @Html.TextBoxFor(m => m.FirstName)
                        @Html.ValidationMessageFor(m => m.FirstName)
                    </td>
                </tr>
                <tr>
                    <td class="editor-label">
                        @Html.LabelFor(m => m.MiddleName)
                    </td>
                    <td class="editor-field">
                        @Html.TextBoxFor(m => m.MiddleName)
                        @Html.ValidationMessageFor(m => m.MiddleName)
                    </td>
                </tr>
                <tr>
                    <td class="editor-label">
                        @Html.LabelFor(m => m.LastName)
                    </td>
                    <td class="editor-field">
                        @Html.TextBoxFor(m => m.LastName)
                        @Html.ValidationMessageFor(m => m.LastName)
                    </td>
                </tr>
                <tr>
                    <td class="editor-label">
                        @Html.LabelFor(m => m.Born)
                    </td>
                    <td class="editor-field">
                        @Html.TextBoxFor(m => m.Born)
                        @Html.ValidationMessageFor(m => m.Born)
                    </td>
                </tr>
                <tr>
                    <td class="editor-label">
                        @Html.LabelFor(m => m.Died)
                    </td>
                    <td class="editor-field">
                        @Html.TextBoxFor(m => m.Died)
                        @Html.ValidationMessageFor(m => m.Died)
                    </td>
                </tr>
                <tr>
                    <td class="editor-label">
                        @Html.LabelFor(m => m.Country)
                    </td>
                    <td class="editor-field">
                        @{var lstCountry = ViewData["ListCountry"] as System.Collections.IEnumerable; }
                        @Html.DropDownListFor(m => m.Country, new SelectList(lstCountry, "Id", "Country"), new { id = "ddlCountry" })
                        @Html.ValidationMessageFor(m => m.Country)

                    </td>
                </tr>
                <tr>
                    <td class="editor-label">
                        @Html.LabelFor(m => m.BornDiedTextId)
                    </td>
                    <td class="editor-field">
                        @{var lstBornDiedText = ViewData["ListBornDiedText"] as System.Collections.IEnumerable; }
                        @Html.DropDownListFor(m => m.BornDiedTextId, new SelectList(lstBornDiedText, "BornDiedTextId", "BornDiedText"), new { id = "ddlBornDiedText" })
                        @Html.ValidationMessageFor(m => m.BornDiedTextId)

                    </td>
                </tr>
               
                <tr>
                    <td class="editor-label">
                        @Html.LabelFor(m => m.Affiliate_Id)
                    </td>
                    <td class="editor-field">
                        @Html.TextBoxFor(m => m.Affiliate_Id)
                        @Html.ValidationMessageFor(m => m.Affiliate_Id)
                    </td>
                </tr>
                 
                <tr>
                    <td colspan="2">
                        <img class="NFButtonLeft NFh" src="/Content/Img/0.png"><input type="submit" class="NFButton NFh" value="Update" /><img class="NFButtonRight NFh" src="/Content/Img/0.png"> @Html.ActionLink("Back", "Index")
                    </td>
                </tr>
            </table>
            
        </div>
    }